<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("path",path);
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>管理界面-商品下架</title>
		<link rel="stylesheet"   type="text/css" href="/common/css/systemer/gljm_spsj.css"/>
		<script type="text/javascript" src="/common/js/jquery-1.11.3.js" ></script>
	</head>
	<body>
		<div class="" style="left: 0px;"> 
			<div class="Sellerber_header apex clearfix" id="Sellerber_header" style="height: 70px;">
			   <div class="l_f logo"><img src="http://localhost:8083/fileserver/a/logo.jpg" style="height: 70px;"/>
			   </div>
			   <div class="r_f Columns_top clearfix">
				   <!--<div class="time_style"><i class="fa  fa-clock-o"></i><span id="time"></span></div>-->
				  	<div class="administrator l_f">
				  		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				   		<span class="" style="">欢迎您,超级管理员</span><i class="glyph-icon fa  fa-caret-down"></i>
				      	<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				      	<span class="tuichu" style=""><a href="/user/loginreg/login">退出</a></span>
				      	<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				  	</div>
			   </div>
			</div>
			<div class="clear"></div>
			<div class="zhong">
				
			
			<div class="Sellerber_left menu " >
				<div class="menu_style" id="menu_style" style="overflow: hidden;outline: none;" tabindex="5000">
					<div class="list_content" style="width: 200px;height: 845px; background-color: #f9f9f9; float: left;">
						<ul class="nav_link open aa">
							<h3>首页</h3>
							<a href="/systemer/malldetail"><li style="color: #393939;" class="aa">金额总汇</li></a>
						</ul>
						<ul class="nav_link open aa">
							<h3>商品管理</h3>
							<a href="/systemer/gljmspsj"><li style="color: #393939;" class="aa">商品上架</li></a>
							<a href="/systemer/gljmspxj"><li style="color: #393939;" class="aa" id="a">商品下架</li></a>
							<a href="/systemer/gljmtjsp"><li style="color: #393939;" class="aa">添加商品</li></a>
							<a href="/systemer/gljmtjkc"><li style="color: #393939;" class="aa">添加库存</li></a>
							<a href="/systemer/gljmscsp"><li style="color: #393939;" class="aa">删除商品</li></a>
						</ul>
						<ul class="nav_link open aa">
							<h3>订单管理</h3>
							<a href="/systemer/gljmspfh"><li style="color: #393939;" class="aa">商品发货</li></a>
							<!--  <a href=""><li style="color: #393939;" class="aa">退款操作</li></a>-->
						</ul>
						<ul class="nav_link open aa">
							<h3>用户管理</h3>
							<a href="/systemer/gljmscyh"><li style="color: #393939;" class="aa">删除用户</li></a>
							<!--<a href=""><li style="color: #393939;" class="aa">修改用户信息</li></a>-->
						</ul>
						<ul class="nav_link open aa">
							<h3>管理员管理</h3>
							<a href="/systemer/gljmtjgly"><li style="color: #393939;" class="aa">添加管理员</li></a>
							
							<!--<a href=""><li style="color: #393939;" class="aa">修改密码</li></a>-->
							
							<a href="/systemer/gljmscgly"><li style="color: #393939;" class="aa">删除管理员</li></a>
						</ul>
					
					</div>
				<div class="margin" style="overflow: hidden;outline: none;" tabindex="5000">
					<div class="operation clearfix">
						<button class="btn button_btn btn-danger" type="button" onclick="DelSelect()"><i class="fa fa-trash-o"></i>&nbsp;下架</button>
						<div class="search  clearfix">
						<form action="/systemer/gljmspxjss" method="post">
						<label class="label_name">商品搜索：</label>
						<input name="waresName" type="text" class="form-control col-xs-6">
						<button class="btn button_btn bg-deep-blue " onclick="" type="submit">
						<i class="fa  fa-search"></i>&nbsp;搜索</button>
						</form>
						
						
						</div>
					</div>
				</div>
				<div class="zhongyou">
					<form action="" method="post" id="del">
					<table class="table table-bordered" >
						<tr>
						<th style="text-align: center; width: 1%"> <label> <input type="checkbox" id="checkall" class="ace"> <span class="lbl"></span> </input> </label></th>
						<th style="text-align: center; width: 3%">商品图片</th>
						<th style="text-align: center; width: 5%">商品id</th>	
						<th style="text-align: center; width: 5%">商品名</th>
						<th style="text-align: center; width: 3%">销量</th>
						<th style="text-align: center; width: 3%">库存</th>
						<th style="text-align: center; width: 5%">上架状态</th>
						<th style="text-align: center; width: 5%">操作</th>
						</tr>
						<c:forEach items="${Waress}" var="pro" varStatus="status" begin="${sessionScope.pages.startIndex}" end="${sessionScope.pages.endIndex-1}">
						<tr>
							<th style="text-align: center; width: 1%"> <label> <input type="checkbox" name="id" value="${pro.waresId}" class="ace"> <span class="lbl"></span> </input> </label></th>
						<td style="text-align: center;"> <a style="height: 50px; width:50px; margin: 0; padding: 0;" href="http://localhost:8083/fileserver/wares/${pro.imgA}" target="_blank"> <img style="height: 50px; width:50px;" alt="" src="http://localhost:8083/fileserver/wares/${pro.imgA}" > </a></td>
						<td style="text-align: center;">${pro.waresId }</td>
						<td style="text-align: center;">${pro.waresName}</td>
						<td style="text-align: center;">${pro.salesVolume}</td>
						<td style="text-align: center;">${pro.waresCount}</td>
						<td style="text-align: center;">已上架</td>
						<td style="text-align: center;"><a id="shanchu" href="/systemer/gljmspxjxj?id=${pro.waresId}">下架</a></td>
						</tr>
						</c:forEach>
					</table>
					</form>
					<div id="a2">
			<center >
			<ul class="pager" style="margin-bottom: 0px">
  				<li class="first" page="1"><a href="/systemer/gljmspxj?curPage=1"><span>首页</span></a></li>
  				<c:forEach 
  					varStatus="statu" 
  					begin="${sessionScope.pages.curPage-2>0?sessionScope.pages.curPage-2:1}" 	
					end="${sessionScope.pages.curPage+2<=sessionScope.pages.totalPage?sessionScope.pages.curPage+2:sessionScope.pages.totalPage}"
  					step="1">
  					<li page="${statu.index}"><a href="/systemer/gljmspxj?curPage=${statu.index}"><span>${statu.index}</span></a></li>
  				</c:forEach>
  				<div></div>
  				<li class="last" page="${sessionScope.pages.totalPage}"><a href="/systemer/gljmspxj?curPage=${sessionScope.pages.totalPage}"><span>尾页</span></a></li>
  				
  				
			</ul>
			</center>
			</div>
				</div>
				</div>
				
			</div>
			
			</div>
			<div class="Sellerber_bottom info" id="bottom" style="height: 31px; line-height: 30px;">
  				<span class="l_f">版权所有：卓应商城</span>
  			</div>
			
		</div>
	</body>
			<script type="text/javascript">
		//多选框
		$("#checkall").click(function(){ 
			if(this.checked){
			  $("input[name='id']").each(function(){
				  this.checked = true;
			  });}else{
				  $("input[name='id']").each(function(){
					  this.checked = false;
				  });}
		})
		 $("input[name='id']").click(function(){
			 $ipts = $("input[name='id']");
			 
			 $("#checkall").prop("checked",($ipts.length == $ipts.filter(":checked").length)?true:false)			 
		})
		
//批量下架
function DelSelect(){
	var Checkbox=false;
	 $("input[name='id']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要下架选中的内容吗？");
		if (t==false) return false;		
		$("#del").attr("action","/systemer/gljmspxjxj");
		$("#del").submit();		
	}
	else{
		alert("请选择您要下架的内容!");
		return false;
	}
}
		//设置条件bean中的 页码
		conditionBean.curPage = $(this).attr("page");
		
		//重新加载界面
		$(".main-classify").load(
		"/product/showfy",
		conditionBean,
		function(){}
		
		); 
		</script>
</html>
